package com.hrsaas.ext.spider.core.header;

import io.netty.handler.codec.http.HttpHeaderNames;

/**
 * <p>
 * 功能：useragent
 * <p>
 * 
 * @author wangxiaoliang@kanzhun.com
 *
 *         2018年8月2日
 */
public enum UserAgent {

	CHROME("Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0"),
	FIREFOX("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0"),
	Safari("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"),
	Opera("Opera/9.80 (Windows NT 6.1; U; zh-cn) Presto/2.9.168 Version/11.50"),
	Win7ie9("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; Tablet PC 2.0; .NET4.0E)"),
	Win7ie8("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3)"),
	WinXPie8("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.0)"),
	WinXPie7("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"),
	WinXPie6("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"),;

	private UserAgent(String useragent) {
		this.value = useragent;
	}

	private String value;

	/**
	 * 随机获取 useragent
	 * @return
	 */
	public static String getDefault() {
		return CHROME.value();
	}

	public String getKey() {
		return HttpHeaderNames.USER_AGENT.toString();
	}
	
	@Override
	public String toString() {
		return this.value;
	}
	
	public String value() {
		return this.value;
	}
	
}
